package pl.polidea.constrainedbuffer;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;

public class BufferEntry implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = -3754657205212619048L;

    public BufferEntry(final String file, final int size2, final long time2) {
        this.file = file;
        size = size2;
        time = time2;
    }

    public BufferEntry() {
        // TODO Auto-generated constructor stub
    }

    String file = null;
    int size = -1;
    long time = 0;

    private void writeObject(final java.io.ObjectOutputStream out) throws IOException {
        final DataOutputStream stream = new DataOutputStream(out);
        stream.writeUTF(this.file);
        stream.writeInt(size);
        stream.writeLong(time);
    }

    private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
        final DataInputStream stream = new DataInputStream(in);
        this.file = stream.readUTF();
        size = stream.readInt();
        time = stream.readLong();
    }

}
